]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
osdWindow: Check monitor validity before updating
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 3 May 2014 19:12:29 +0000 (21:12 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 8 May 2014 09:14:23 +0000 (11:14 +0200)
When a monitor is removed, the OsdWindow for that monitor may process
the monitors-changed signal before OsdWindowManager does (which will
remove the OSD). If that happens, we will currently try to access
an invalid monitor; check for this to avoid a couple of warning.

js/ui/osdWindow.js

index 6263070d1ad6553c1c04ed5e2f21a222c771c5f8..bcdc391808c6672b0303c37753216fa01c2b3ae0 100644 (file)
@@ -192,6 +192,8 @@ const OsdWindow = new Lang.Class({
     _monitorsChanged: function() {
         /* assume 110x110 on a 640x480 display and scale from there */
         let monitor = Main.layoutManager.monitors[this._monitorIndex];
+        if (!monitor)
+            return; // we are about to be removed
 
         let scalew = monitor.width / 640.0;
         let scaleh = monitor.height / 480.0;